package cn.edu.zafu.bigdata.x.Foo;

class MathOperations {
    //返回两个整数的和
    public int add(int a,int b){
        return a+b;
    }

    //返回两个浮点数的和
    public double add(double a,double b){
        return a+b;
    }

    //返回三个整数的和
    public int add(int a,int b,int c){
        return a+b+c;
    }
}


public class TextMathOperations {
    public static void main(String[] args) {
        MathOperations mathOperations = new MathOperations();

        // 测试整数加法
        int sumInt = mathOperations.add(5, 10);
        System.out.println("整数和: " + sumInt);

        // 测试浮点数加法
        double sumDouble = mathOperations.add(5.5, 10.5);
        System.out.println("浮点数和: " + sumDouble);

        // 测试三个整数的加法
        int sumIntThree = mathOperations.add(5, 10, 15);
        System.out.println("三个整数的和: " + sumIntThree);
    }
}
